package com.kefu.robot.vo;

import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.util.IdUtil;
import com.kefu.common.context.KefuContext;
import com.kefu.common.vo.AbstractInsertVo;
import com.kefu.robot.model.RobotInfo;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.ToString;

import javax.validation.constraints.Size;

@Data
@EqualsAndHashCode(callSuper = true)
@ToString(callSuper = true)
@ApiModel(description = "机器人")
public class RobotInfoInsertVo extends AbstractInsertVo<RobotInfo> {

    @Size(max = 16)
    @ApiModelProperty(name = "robotName", value = "名称")
    private String robotName;
    @Size(max = 128)
    @ApiModelProperty(name = "robotIcon", value = "图标")
    private String robotIcon;
    @Size(max = 32)
    @ApiModelProperty(name = "robotDesc", value = "机器人备注")
    private String robotDesc;
    @ApiModelProperty(name = "greetBase", value = "基本寒暄：0停用，1启用")
    private Integer greetBase;
    @ApiModelProperty(name = "greetNetwork", value = "互联网寒暄：0停用，1启用")
    private Integer greetNetwork;
    @ApiModelProperty(name = "greetNetwork", value = "AI大模型状态 0：关闭 1：启用")
    private Integer aidataStatus;
    @ApiModelProperty(name = "greetNetwork", value = "AI大模型id")
    private String aidataId;

    @Override
    public RobotInfo convert() {
        RobotInfo info = BeanUtil.toBean(this, RobotInfo.class);
        KefuContext context = KefuContext.getKefuContext();
        info.setId(IdUtil.simpleUUID());
        info.setTenantId(context.getTenantId());
        info.setCreateTime(context.getNow());
        info.setCreateUser(context.getUserId());
        info.setUpdateTime(context.getNow());
        info.setUpdateUser(context.getUserId());
        return info;

    }

}